from typing import Optional

from pydantic import BaseModel
from datetime import datetime

class CertificateBase(BaseModel):
    domain: str
    cert: Optional[str] = None
    fullchain: str
    privkey: str
    requested_at: Optional[datetime] = None

class CertificateCreate(CertificateBase):
    pass

class CertificateUpdate(CertificateBase):
    pass

class CertificateOut(CertificateBase):
    id: int

    class Config:
        orm_mode = True

class CertificateApply(BaseModel):
    domain: str
    host: str


class CertificateSchema(BaseModel):
    cert: str
    privkey: str
    fullchain: str

